package com.lgd.tools;

import clover.com.google.common.collect.ArrayListMultimap;
import clover.com.google.common.collect.Multimap;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by 299174105 on 2017/7/5.
 */
public class LambdaTest {
    public static void main(String[] args) {

        /*String[] array = {"a", "b", "c"};
        for(Integer i : Lists.newArrayList(1,2,3)){
            Stream.of(array).map(item -> Strings.padEnd(item, i, '@')).forEach(System.out::println);
        }*/
        //guava测试
        Multimap<String,Integer> map = ArrayListMultimap.create();
        map.put("a",1);
        map.put("a",2);
        map.put("a",3);
        map.put("b",3);
        map.put("b",3);
        map.put("b",3);
        map.put("b",3);
//        System.out.println(map.get("b"));
        List<String> names = new ArrayList<>();
        names.add("TaoBao");
        names.add("ZhiFuBao");
        List<String> lowercaseNames = names.stream().map(name -> name.toLowerCase()).collect(Collectors.toList());
        List<String> collect = names.stream().map(String::toLowerCase).collect(Collectors.toList());
        List<String> taoBao = names.stream().filter(name -> name.equals("TaoBao")).collect(Collectors.toList());
        long count = names.stream().limit(1).peek(System.out::println).count();

    }

}

